﻿@using Library
@model Ecommerce.Models.ApplicationUser
@{
    var isRootAdmin = Model.Roles.Any(ur => ur.RoleId == Settings.RootAdminRoleId);
}
<tr data-id="@Model.Id">
    <th scope="row">@Html.DisplayFor(m => Model.UserName)</th>
    <td>@Html.DisplayFor(m => Model.FullName)</td>
    <td>@Html.DisplayFor(m => Model.PhoneNumber)</td>
    <td>@Html.DisplayFor(m => Model.Gender, "Gender")</td>
    <td>@Html.DisplayFor(m => Model.Birthday, "Date")</td>
    <td>@Html.DisplayFor(m => Model.PositionInOrganization)</td>
    <td>
        <button type="button" class="btn btn-sm btn-primary" data-editor="edit" data-id="@Model.Id"><span class="glyphicon glyphicon-edit"></span>@NOWCulture.GetString("Edit")</button>
        @if (!isRootAdmin)
        {
            <button type="button" class="btn btn-sm btn-danger" data-editor="remove" data-id="@Model.Id"><span class="glyphicon glyphicon-remove"></span>@NOWCulture.GetString("Remove")</button>
        }
        <button type="button" class="btn btn-sm btn-info" data-editor="changepassword" data-id="@Model.Id"><span class="glyphicon glyphicon-lock"></span>@NOWCulture.GetString("Change password")</button>
        @if (!isRootAdmin)
        {
            <button type="button" class="btn btn-sm btn-warning" data-editor="changeroles" data-id="@Model.Id"><span class="glyphicon glyphicon-briefcase"></span>@NOWCulture.GetString("Roles")</button>
        }
    </td>
</tr>
